import request from '@/utils/request'
export default {
    //获取用户信息
    getInfo(username) {
        const url = `/v3/virtualSystem/v1/user/queryDetailInfo?username=${username}`
        return request({
            url: url,
            method: 'get'
        })
    },
    //获取顶级组织
    queryTopOrganization() {
        const url = `/v3/virtualSystem/queryTopOrganization`
        return request({
            url: url,
            method: 'get'
        })
    },
    //根据顶级组织编号获取对应数据库
    queryByOrganizationNo(no) {
        const url = `/v3/organization/organizationToDatabaseMapper/queryByOrganizationNo?no=${no}`
        return request({
            url: url,
            method: 'get'
        })
    },
    //根据顶级组织编号查询虚拟系统下的组织
    queryOrganization(no) {
        const url = `/v3/virtualSystem/queryOrganization?topOrganizationNo=${no}`
        return request({
            url: url,
            method: 'get'
        })
    },
    //查询组织下的组织
    queryTreeByOrganizationNoList(noList) {
        const url = `/v3/organization/organization/queryTreeByOrganizationNoList?noList=${noList}`
        return request({
            url: url,
            method: 'get'
        })
    },
    //获取子组织编号
    queryChildOrganizationNo() {
        const url = `/v3/organization/organization/queryChildOrganizationNo`
        return request({
            url: url,
            method: 'get'
        })
    },
    //获取组织下的系统
    queryVirtualSystem() {
        const url = `/v3/authority/v1/virtualSystem/queryVirtualSystem`
        return request({
            url: url,
            method: 'get'
        })
    },
    //获取驾驶舱
    queryBigScreen(data) {
        const url = `/v3/organization/organizationBigScreen/queryByCondition`
        return request({
            url: url,
            method: 'post',
            data
        })
    },
    //获取菜单
    getSystemMenu(no) {
        const url = `/v3/authority/v1/menu/getUserMenuByFarmingType?no=dp`
        return request({
            url: url,
            method: 'get'
        })
    },
    //页面元素
    queryPageElement(virtualSystemNo) {
        const url = `/v3/authority/v1/pageElement/queryPageElement?virtualSystemNo=${virtualSystemNo}`
        return request({
            url: url,
            method: 'get'
        })
    },
    //通过权限获取当前菜单下的功能
    getRoleFunctionAll(virtualSystemNo, menuNo) {
        const url = `/v3/authority/v1/function/getRoleFunctionAll?virtualSystemNo=${virtualSystemNo}&menuNo=${menuNo}`
        return request({
            url: url,
            method: 'get'
        })
    },
    // 查询所有菜单
    queryMenuAll(no) {
        return request.get(`/v3/authority/v1/menu/getSystemMenu?virtualSystemNo=${no}`);
    },
    // 查询所有菜单
    queryMenuAll(no) {
        return request.get(`/v3/authority/v1/menu/getSystemMenu?virtualSystemNo=${no}`);
    },
}
